<?php

class Db_Autor extends Model_Db_Core {

	protected  $autor   = null;
	
	function __construct(){		
	}
	
	public function getAutorByName($name){
	    $filter  = array('name'=> $name);
	    $select  = array('id');
	    
	    parent::getSQLResult(__CLASS__,$filter,$select);
	    $this->autor = parent::result();

	    return $this->autor;
	}
	public function setAutor($name) {       
		parent::setInsert(__CLASS__);
		 	 	
		$this->value['name'] = $name;
		$this->value['genre'] = "NULL";
		$this->value['publisher'] = "NULL";
		$this->value['pic'] = "NULL";
				
	    $status = $this->writeToDb();
	    
	    return $status;
	}  
	
	
	
}

?>